import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.security.PublicKey;


public class mainc
{

	//private static Object stChoice;
    private static String stChoice="";
	public static boolean home(int book ) throws Exception

	{
		boolean blAdded=false;
		boolean b2Added=false;
		boolean b3Added=false;
		boolean b4Added=false;
		//	BufferedReader brObj1= new BufferedReader(new InputStreamReader(System.in));
		//	String stChoice=brObj1.readLine();
		//	int inMaxBooks=2;
		//int book = 0;

		do
		{

			System.out.println("Enter Your Choice");
			System.out.println("1.Add Book");
			System.out.println("2.remove Book");
			System.out.println("3.check Availablity");
			System.out.println("4.Exit");

			System.out.println("Enter the option value");
			BufferedReader brObj= new BufferedReader(new InputStreamReader(System.in));
			String stChoice=brObj.readLine();
			if(stChoice.equals("1")){
				System.out.println("please enter the book name:");
				//String stBookName=brObj.readLine();
			//	admin kathir=new admin();
				//boolean blFlag=kathir.addBookToShelf(stBookName);
				String stNumBooks=brObj.readLine();
				admin kathiresh=new admin();
				boolean NumBooks=kathiresh.addBookToShelf(stNumBooks);
				/** if(blFlag){

			 book++;
			 if(book<=inMaxBooks){
				 System.out.println(" Book added to self location"+book);	 
				 home(book);
			 }

			 else
				 System.out.println("Max capacity reached");

		 }*/
				//return blAdded;
			} 
			else if(stChoice.equals("2"))
			{


				//BufferedReader brObj1= new BufferedReader(new InputStreamReader(System.in));
				//String stChoice=brObj1.readLine();

				// boolean b2Added = false;
				System.out.println("please enter the book name:");
				brObj=new BufferedReader(new InputStreamReader(System.in));
				//String stChoice1=brObj1.readLine();
				String stBookName=brObj.readLine();
				admin katty=new admin();
				boolean BookName = katty.removeBookFromShelf(stBookName);
				// b2added = true;
				System.out.println("the book is removed from self"+stBookName);
			//	return b2Added;

			}	
			else if(stChoice.equals("3"))
			{

				System.out.println("please enter the book name:");
				BufferedReader brObj3=new BufferedReader(new InputStreamReader(System.in));
				String stBookName=brObj3.readLine();
				admin Gowtham=new admin();
				boolean BookName = Gowtham.bookavailablity(stBookName);


				//BufferedReader brObj2= new BufferedReader(new InputStreamReader(System.in));
				//String strChoice=brObj2.readLine();



				//return b3Added;
			}

			else if (stChoice.equals("4"))
			{
				//BufferedReader brObj4= new BufferedReader(new InputStreamReader(System.in));
				//String stChoice=brObj4.readLine();

				// boolean b4Added=false;
				System.out.println("Exit");
				System.exit(0);

				//  boolean b4Added=true;
			//	return b4Added;
			}
			stChoice.equals("");
			System.out.println("stChoice : "+ stChoice);
		}
		while(!stChoice.equals("4"));
		
		//stChoice.equals("");
	return b4Added;

		//else
		//	{
		//	System.out.println("Exit");
		//		return false;
		//	}

	}
	//	return b3Added;


	public static void main(String[] args) throws Exception {

		try {
			int book=0;
			home(book);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

		//  boolean b4Added;
		//   BufferedReader brObj1= new BufferedReader(new InputStreamReader(System.in));
		//   String stChoice=brObj1.readLine();
		/**		 if(stChoice.equals("4"))
		{
			BufferedReader brObj4= new BufferedReader(new InputStreamReader(System.in));
		    String stChoice=brObj4.readLine();
		     {
		    	 boolean b4Added=false;
		    	 System.out.println("Exit");
		    	 System.exit(0);
		     }
		     boolean b4Added=true;
		     return;
	}

		 */

	}

}
